package com.thewaybetter.modules.server.dao.factory;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;

public final class PMF {

	private static final PersistenceManagerFactory pmfInstance = JDOHelper.getPersistenceManagerFactory("transactions-optional");

	private PMF(){ }
	
	public static final PersistenceManagerFactory getFactory(){
		return pmfInstance;
	}
	
	public static final PersistenceManager getManager(){
		return getFactory().getPersistenceManager();
	}
	
	public static final void saveObject(Object obj){
		getManager().makePersistent(obj);
	}
	
}
